/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.GUI.setting;

import ac.ui.controls.PCLButton;
import ac.ui.controls.PCLFrame;
import javax.swing.JButton;

/**
 *
 * @author empcl_000
 */
public class f_setting extends PCLFrame {

    ac.ui.utils u = new ac.ui.utils();

    /**
     * Creates new form f_setting
     */
    public f_setting(String status) {

        initComponents();
        //u.Panelopen(cont_pn, new genSetting());
        onLoad();

        updateStatus(status);
    }

    void updateStatus(String status) {
        boolean s = true;
        if (status.equalsIgnoreCase("gen")) {
            s = false;
        }

        jbt_users.setVisible(s);
        jbt_menus.setVisible(s);
        jbt_limits.setVisible(s);
        jbt_data.setVisible(s);

    }

    void updatelabel(java.awt.event.ActionEvent evt) {

        javax.swing.JButton bt = (javax.swing.JButton) evt.getSource();

        jlb_label.setText(bt.getText());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        user_bt2 = new javax.swing.JButton();
        jbt_users = new javax.swing.JButton();
        jbt_menus = new javax.swing.JButton();
        general_bt = new javax.swing.JButton();
        user_bt3 = new javax.swing.JButton();
        jbt_limits = new javax.swing.JButton();
        jbt_data = new javax.swing.JButton();
        jbt_data1 = new javax.swing.JButton();
        jbt_data2 = new javax.swing.JButton();
        cont_pn = new javax.swing.JPanel();
        jlb_label = new ac.ui.controls.PCLLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setAlwaysOnTop(true);
        setResizable(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        user_bt2.setText("jbt_dbStting");
        user_bt2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                user_bt2ActionPerformed(evt);
            }
        });

        jbt_users.setText("bt_users");
        jbt_users.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_usersActionPerformed(evt);
            }
        });

        jbt_menus.setText("bt_menuSetting");
        jbt_menus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_menusActionPerformed(evt);
            }
        });

        general_bt.setText("bt_general");
        general_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                general_btActionPerformed(evt);
            }
        });

        user_bt3.setText("jbt_styleSetting");
        user_bt3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                user_bt3ActionPerformed(evt);
            }
        });

        jbt_limits.setText("bt_limites");
        jbt_limits.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_limitsActionPerformed(evt);
            }
        });

        jbt_data.setText("bt_dataSetting");
        jbt_data.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_dataActionPerformed(evt);
            }
        });

        jbt_data1.setText("bt_company");
        jbt_data1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_data1ActionPerformed(evt);
            }
        });

        jbt_data2.setText("bt_print");
        jbt_data2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbt_data2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(user_bt2, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_users, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_menus, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(general_bt, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(user_bt3, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_limits, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_data, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_data1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbt_data2, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {general_bt, jbt_data, jbt_limits, jbt_menus, jbt_users, user_bt2, user_bt3});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(general_bt)
                .addGap(4, 4, 4)
                .addComponent(user_bt2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(user_bt3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_users)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_menus)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_limits)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_data)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_data1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbt_data2)
                .addContainerGap(249, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {general_bt, jbt_data, jbt_limits, jbt_menus, jbt_users, user_bt2, user_bt3});

        cont_pn.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        cont_pn.setPreferredSize(new java.awt.Dimension(473, 200));

        javax.swing.GroupLayout cont_pnLayout = new javax.swing.GroupLayout(cont_pn);
        cont_pn.setLayout(cont_pnLayout);
        cont_pnLayout.setHorizontalGroup(
            cont_pnLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 393, Short.MAX_VALUE)
        );
        cont_pnLayout.setVerticalGroup(
            cont_pnLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        jlb_label.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jlb_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlb_label.setToolTipText("");
        jlb_label.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cont_pn, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
                    .addComponent(jlb_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jlb_label, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cont_pn, javax.swing.GroupLayout.DEFAULT_SIZE, 471, Short.MAX_VALUE)))
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void general_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_general_btActionPerformed
        updatelabel(evt);
        u.Panelopen(cont_pn, new genSetting());
    }//GEN-LAST:event_general_btActionPerformed

    private void jbt_menusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_menusActionPerformed
        updatelabel(evt);
    }//GEN-LAST:event_jbt_menusActionPerformed

    private void jbt_usersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_usersActionPerformed

        u.Panelopen(cont_pn, new usersSetting());
        updatelabel(evt);
    }//GEN-LAST:event_jbt_usersActionPerformed

    private void user_bt2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_user_bt2ActionPerformed
        u.Panelopen(cont_pn, new DBInfo());
        updatelabel(evt);
    }//GEN-LAST:event_user_bt2ActionPerformed

    private void user_bt3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_user_bt3ActionPerformed
        u.Panelopen(cont_pn, new styleSetting());
        updatelabel(evt);
    }//GEN-LAST:event_user_bt3ActionPerformed

    private void jbt_limitsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_limitsActionPerformed
        u.Panelopen(cont_pn, new lsetting());
        updatelabel(evt);
    }//GEN-LAST:event_jbt_limitsActionPerformed

    private void jbt_dataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_dataActionPerformed
        u.Panelopen(cont_pn, new dataSetting());
        updatelabel(evt);
    }//GEN-LAST:event_jbt_dataActionPerformed

    private void jbt_data1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_data1ActionPerformed
        u.Panelopen(cont_pn, new company());
        updatelabel(evt);
    }//GEN-LAST:event_jbt_data1ActionPerformed

    private void jbt_data2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbt_data2ActionPerformed
        u.Panelopen(cont_pn, new print());

        updatelabel(evt);


    }//GEN-LAST:event_jbt_data2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(f_setting.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(f_setting.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(f_setting.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(f_setting.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new f_setting("").setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel cont_pn;
    private javax.swing.JButton general_bt;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton jbt_data;
    private javax.swing.JButton jbt_data1;
    private javax.swing.JButton jbt_data2;
    private javax.swing.JButton jbt_limits;
    private javax.swing.JButton jbt_menus;
    private javax.swing.JButton jbt_users;
    private ac.ui.controls.PCLLabel jlb_label;
    private javax.swing.JButton user_bt2;
    private javax.swing.JButton user_bt3;
    // End of variables declaration//GEN-END:variables
}
